package com.cherrish.config;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author cherrish
 * @time 2018-09-04 15:28
 * @name TokenStorePostProcessorConfig
 * @desc:
 */
@Component
public class TokenStorePostProcessorConfig implements BeanPostProcessor{
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {

        if (StringUtils.equals(beanName,"inMemoryTokenStore")){
            return this;
        }
        return bean;
    }
}
